<?php

namespace App\Http\Controllers\Api;

use App\Club;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class ClubController extends Controller
{
    public function index()
    {
        $club = Club::all();
        $filter = collect();
        foreach ($club as $key ) {
            if($key->status == 1)
                $filter->push($key);
        }
        return [
            'status' => 'success',
            'data_size' => $filter->count(),
            'data' => $filter
        ];
    }

    public function detail($id)
    {
        return [
            'status' => 'success',
            'data' => Club::find($id)
        ];
    }

    public function courselist($id)
    {

    }
}
